@extends('wap.layout.base')
@section('scripts')
    <script>
        $(function(){
            $('.user-list p').click(function(){
                let target = $(this).attr('data-route');
                window.location.href = target;
            });

            $('.publish').click(function(){
                window.location.href = "{{ route('wap.user.publish') }}";
            });

        })
    </script>
@endsection
@section('content')
    @include('wap.layout.header')
    <div class="container main user">
        <div class="row">
            <div class="user-head">
                <div class="user-bg"></div>
                <table>
                    <tr>
                        <td>积分</td>
                        <td>{{ auth()->user()->integral }}</td>
                    </tr>
                </table>
                <div class="user-info">
                    <img src="{{ auth()->user()->avatar }}" alt="">
                    <div>
                        <p class="user-info-name">{{ auth()->user()->name }}</p>
                        <p class="user-info-company">{{ auth()->user()->company }}</p>
                    </div>
                </div>
                @if(auth()->user()->column == 2)
                <span class="publish">
                    <img src="{{ asset('img/b.png') }}" alt="">
                    <span>发布</span>
                </span>
                @endif
            </div>
            <div style="background: #f8f8f8;height: 1rem"></div>
            <div class="col-xs-12 user-list">
                <p data-route="{{ route('wap.user.detail') }}"><i class="fa fa-vcard-o"></i> 基本信息 <i class="fa fa-angle-right"></i></p>
                <p data-route="{{ route('wap.user.password') }}"><i class="fa fa-shield"></i> 修改密码 <i class="fa fa-angle-right"></i></p>
                <p data-route="{{ route('wap.user.praise') }}"><i class="fa fa-thumbs-o-up"></i> 点赞记录 <i class="fa fa-angle-right"></i></p>
                @if(auth()->user()->column == 2)
                    <p data-route="{{ route('wap.user.article') }}"><i class="fa fa-file-text-o"></i> 我的发布 <i class="fa fa-angle-right"></i></p>
                @else
                    <p data-route="{{ route('wap.user.join') }}"><i class="fa fa-diamond"></i> 申请专栏 <i class="fa fa-angle-right"></i></p>
                @endif
                <p data-route="{{ route('wap.auth.logout') }}"><i class="fa fa-sign-out"></i> 退出登录 <i class="fa fa-angle-right"></i></p>
            </div>
        </div>
    </div>
    @include('wap.layout.tabbar')
@endsection

